﻿<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>系统配置管理器</title>
	<meta name="decorator" content="default"/>
	<tags:import includes="spinner,bootbox,form"></tags:import>
	<script src="${ctxStatic}/modules/sys/config.js"></script>
	<script type="text/javascript">
		var _ctx = '${ctx}';
		
		function refresh(){
			location.reload();
		}
		
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#frmSearch").submit();
			return false;
		}
	</script>
</head>
<body>
	<br>
	<form id="frmSearch" modelAttribute="entity" action="${ctx}/sys/config/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>		
		<!--添加查询条件-->		
		<label>分类：</label><widgets:select all="true"  value="${entity.value}" datasource="${fns:getAllDictType()}"  dictName="value" dispVar="type"  dataPlaceholder="字典类型"></widgets:select>
		&nbsp;&nbsp; <label>名称 ：</label><input type="text" name="label"  value="${entity.label}"  htmlEscape="false" maxlength="50" class="input-medium"/>		
		<br>
		<br>
		&nbsp;<button id="btnQuery" class="btn btn-success"" type="submit">查询</button>
		&nbsp;<button id="btnNew" class="btn" type="button" >新增</button>
		&nbsp;<button id="btnDelete" class="btn"  type="button" >删除</button>    	
		&nbsp;<button id="btnRstCache" class="btn" type="button" >重置缓存</button>				
	</form>
	<br><br>	
	<table id="contentTable" class="table table-striped table-bordered table-condensed">		
		<thead>
			<tr>
				<th class="center" style="width: 50px;">
					<label> 
						<input type="checkbox" class="ace" /> <span class="lbl"></span>
					</label>
				</th>
		        <th>分类</th>
		        <th>名称</th>
		        <th>值</th>
		        <th>是否可用</th>        
		        <th>字段</th>
		        <th>默认值</th>
		        <th>单位</th>
		        <th>实体</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${pages.list}" var="config">
		<tr>
		<td class="center">
			<label>
				<input value="${config.id}" type="checkbox" class="ace" /> 
				<span class="lbl"></span>
			</label>
		</td>
                 <td>${config.catalog}</td>
                 <td>${config.label}</td>
                 <td>${config.value}</td>
                 <td>${config.isEnable}</td>
                 <td>${config.field}</td>
                 <td>${config.defaultValue}</td>
                 <td>${config.formatStr}</td>
                 <td>${config.mappingEnt}</td>
				<td>
					<a href="javascript:onDelete('${config.id}')">删除</a>
					<a href="javascript:onUpdate('${config.id}')">编辑</a>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	${pages}
	<!-- 模态窗体 -->
	<div id="modalTable" action="new" class="modal fade"  style="display:none;width: 515px;height: 467px;" tabindex="-1">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header no-padding">
					<div class="table-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-hidden="true">
							<span class="white">&times;</span>
						</button>
						<span id='modalTitle'>新增窗体</span>
					</div>
				</div>
				<br>
				<!-- 新增窗体内部 -->
				<form id="frmSubmit" class="form-horizontal" role="form"
					method="post">
					<input type="hidden" name="id" uname="update"/>
					<input type="hidden"  id="callbackPID" name="parentId"  uname="update"/>
					<input type="hidden"  id='callbackPIDS' name="parentIds"  uname="update"/>
					<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right">父级节点</label>
							<div class="col-sm-9">
								<div class="input-group" style="width: 352px;height: 10px;">
								<input class="form-control"  
									uname="update"  
									id="callbackName"	
									type="text"  
									name="parentName"
									style="height: 29px;">
									<span id="btnSelectTree"  class="input-group-addon" style="cursor: hand;">
										<i class="icon-search bigger-110"></i>
									</span>
								</div>									
							</div>
					</div>
			        <div class="form-group">
						<label class="col-sm-2 control-label no-padding-right">分类</label>
						<div class="col-sm-3">
							<widgets:select width="130"
								datasource="${fns:getAllDictType()}"  
								dictName="catalog" 
								dispVar="type" 
								dataPlaceholder="字典类型">
							</widgets:select>
						</div>
						<label class="col-sm-2 control-label no-padding-right">名称</label>
						<div class="col-sm-4">
							<input type="text" class="col-xs-10"
								name="label" uname="update"/>
						</div>
					</div>	
					<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right">是否可用</label>
							<div class="col-sm-3">
								<widgets:select 
									datasource="${fns:getDictList('yes_no')}" 
								    width="130"
								    uname="update"
								 	dictName="isEnable" dataPlaceholder="字典类型">
								 </widgets:select>
							</div>
							<label class="col-sm-2 control-label no-padding-right">字段</label>
							<div class="col-sm-4">
								<input type="text" class="col-xs-10"
									name="field" uname="update"/>
							</div>
					</div>
					<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right">字段类型</label>
							<div class="col-sm-3">
									<widgets:select 
										datasource="${fns:getDictList('sys_field_type')}" 
									    width="130"
									 	dictName="fieldType" dataPlaceholder="字典类型">
									 </widgets:select>
							</div>
							<label class="col-sm-2 control-label no-padding-right">默认值</label>
							<div class="col-sm-5">
								<input type="text" style="width:120px" class="col-xs-10"  name="defaultValue" uname="update"/>
							</div>
					</div>
					<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right">单位</label>
							<div class="col-sm-3">
								<input type="text"  style="width:110px" class="col-xs-10"
									name="formatStr" uname="update"/>
							</div>
							<label class="col-sm-2 control-label no-padding-right">实体</label>
							<div class="col-sm-4">
								<input type="text" class="col-xs-10"
 									name="mappingEnt" uname="update"/>
							</div>
					</div>
					<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right">扩展字段1</label>
							<div class="col-sm-3">
								<input type="text" style="width:110px" class="col-xs-10"
									name="ext_1" uname="update"/>
							</div>
							<label class="col-sm-2 control-label no-padding-right">扩展字段2</label>
							<div class="col-sm-4">
								<input type="text" class="col-xs-10"
									name="ext_2" uname="update"/>
							</div>
					</div>
					<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right">子表单</label>
							<div class="col-sm-8">
								<input type="text" style="width:352px" class="col-xs-10"
								   placeholder="输入子表单名称，用'，'分隔."
									name="childFormList" uname="update"/>
							</div>
					</div>		
					<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right">排序号</label>
							<div class="col-sm-3">
								<input type="text" style="width:110px" class="col-xs-10"
									name="sort" uname="update"/>
							</div>
							<label class="col-sm-2 control-label no-padding-right">是否只读</label>
							<div class="col-sm-4">
								<widgets:select 
									datasource="${fns:getDictList('yes_no')}" 
								    width="130"
								    uname="update"
								 	dictName="readOnly" 
								 	dataPlaceholder="字典类型">
								 </widgets:select>
							</div>
					</div>
					
					<div class="space-4"></div>
					<div class="clearfix form-actions">		
						<div class="center">				
							<button id="btnSubmit" class="btn btn-info" type="button">
								<i class="icon-ok bigger-110"></i> 保存
							</button>
						</div>
							<!-- &nbsp; &nbsp; &nbsp;
							<button class="btn" type="reset">
								<i class="icon-undo bigger-110"></i> 重置
							</button> -->
					</div>
				</form>
				<!-- PAGE CONTENT ENDS -->
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>
	<widgets:treeview url="/sys/config/listDTO" 
	    catalog="network_topo"
  		callbackPID="callbackPID"
  		callbackPIDS="callbackPIDS"
		callbackName="callbackName">
	</widgets:treeview> 
	
</body>
</html>
